//
//  QuestionModel.m
//  Civacrm
//
//  Created by zhk on 2017/2/8.
//  Copyright © 2017年 王桂敏. All rights reserved.
//

#import "QuestionModel.h"

@implementation QuestionModel

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
    
}

- (BOOL)isOpen{
    if (!_isOpen) {
        self.isOpen = NO;
    }
    return _isOpen;
}

- (CGFloat)finalRowHeight{//单元格最终的行高
    CGFloat rowHeight = self.textRect.size.height + h(100) + h(26) + h(24);
    return self.isOpen ? rowHeight : h(100);
}

- (CGRect)textRect{//文本的大小
    CGRect targetRect = [self.content boundingRectWithSize:CGSizeMake(kScreenWidth - w(47) * 2, 2000) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName  : font(28)} context:nil];
    return targetRect;
}

@end
